# 导包
from flask import Flask
from flask import render_template

# 创建实例服务器
app=Flask(__name__)

# 装饰器，指定路由
@app.route("/")
# 创建视图函数
def index():
    resort=["小说","童话","杂志","漫画","教辅工具"]
    return render_template("index.html",**locals())

@app.route("/Conmoice/")
def Conmoice():
    book_list =[
        {"book_name": "一", "book_type": "《灭世武秀》", "author": "余波", "public": "河北教育出版社"},
        {"book_name": "二", "book_type": "《那一眼》", "author": "安徒生", "public": "江苏少年儿童出版社"},
        {"book_name": "三", "book_type": "《红雨鞋》", "author": "伊索著", "public": "湖北少年儿童出版社"},
        {"book_name": "四", "book_type": "《奥特曼》", "author": "金波", "public": "安徽少年儿童出版社"},
        {"book_name": "五", "book_type": "《小怪兽》", "author": "方素珍", "public": "中国福利出版社"},
    ]
    return render_template("Comics.html",**locals())

@app.route("/fairy/")
def fairy():
    book_list =[
        {"book_name": "一", "book_type": "《安徒没有生》", "author": "安徒生", "public": "河北教育出版社"},
        {"book_name": "二", "book_type": "《格林没有童话》", "author": "格林", "public": "江苏少年儿童出版社"},
        {"book_name": "三", "book_type": "《妹妹的红雨鞋》", "author": "妹妹", "public": "湖北少年儿童出版社"},
        {"book_name": "四", "book_type": "《童没有话》", "author": "童话", "public": "安徽少年儿童出版社"},
        {"book_name": "五", "book_type": "《奥利给》", "author": "奥利给", "public": "中国福利出版社"},
    ]
    return render_template("fairy_tale.html",**locals())

@app.route("/Fiction/")
def Fiction():
    book_list =[
        {"book_name": "一", "book_type": "《科比精神》", "author": "科比", "public": "科比精神出版社"},
        {"book_name": "二", "book_type": "《CBA周琦狂砍29分》", "CBA周报": "安徒生", "public": "CBA周报出版社"},
        {"book_name": "三", "book_type": "《国际运动》", "author": "国际报刊", "public": "国际报刊出版社"},
        {"book_name": "四", "book_type": "《哈登夜店狂嗨》", "author": "国际报刊", "public": "国际报刊出版社"},
        {"book_name": "五", "book_type": "《浓眉加入勇士》", "author": "NBA报刊", "public": "NBA报刊出版社"},
    ]
    return render_template("Fiction.html",**locals())

@app.route("/magazi/")
def magazi():
    book_list =[
        {"book_name": "一", "book_type": "《男仆》", "author": "男一", "public": "blibli出版社"},
        {"book_name": "二", "book_type": "《女仆》", "author": "女一", "public": "黑不溜秋出版社"},
        {"book_name": "三", "book_type": "《总裁黑》", "author": "伊索著", "public": "某某某出版社"},
        {"book_name": "四", "book_type": "《豪门事件》", "author": "金波", "public": "金波儿童出版社"},
        {"book_name": "五", "book_type": "《恋爱物语》", "author": "方素珍", "public": "中国恋爱出版社"},
    ]
    return render_template("magazine.html",**locals())

@app.route("/Teaching/")
def Teaching():
    book_list =[
        {"book_name": "一", "book_type": "《高考一日落榜》", "author": "奥特曼", "public": "奥特曼出版社"},
        {"book_name": "二", "book_type": "《那一晚考试》", "author": "葫芦娃", "public": "葫芦娃出版社"},
        {"book_name": "三", "book_type": "《高考英语专题》", "author": "怪兽", "public": "怪兽出版社"},
        {"book_name": "四", "book_type": "《状元之星》", "author": "小金刚", "public": "小金刚出版社"},
        {"book_name": "五", "book_type": "《金榜一号》", "author": "白素珍", "public": "白素珍出版社"},
    ]
    return render_template("Teaching_aids.html",**locals())
# 程序入口
if __name__ == '__main__':
    app.run()
